Repository navigation
fix(store): guard findIndex(-1) in the data store actions - #3220
Open
AndyScherzinger wants to merge 1 commit into
Open
AndyScherzinger wants to merge 1 commit into
AndyScherzinger wants to merge 1 commit into
Conversation
updateColumn and updatePublicRow assigned to columns[stateId][-1] and rows[stateId][-1] when the updated node was not in the local store. That creates a bogus "-1" property the getters never iterate over, so a successful server call left the store silently out of sync instead of either updating or ignoring the node. Replace both with the map() that updateRow already uses, which leaves the collection untouched when the id is absent. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3219, which guarded the
findIndex()results insrc/store/store.js. The same bug is insrc/store/data.js:updateColumnandupdatePublicRowassign tocolumns[stateId][-1]/rows[stateId][-1]when the updated node is not in the local store, creating a bogus"-1"property that the getters never iterate over. A successful server call therefore left the store silently out of sync.Both now use the
map()thatupdateRowalready uses one function over (data.js:362), which leaves the collection untouched when the id is absent. Raised as finding 4 of the review in #3219 (comment), which suggested keeping it out of that PR.Pre-existing on
main.🖼️ Screenshots
n/a — no visual change (internal store guards only).
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)